<!DOCTYPE html>
<html>
<head>
<title>ProFTPD module mod_sql_sqlite</title>
</head>

<body bgcolor=white>

<hr><br>
<center>
<h2><b>ProFTPD module <code>mod_sql_sqlite</code></b></h2>
</center>
<hr><br>

<p>
SQLite is a lightweight embeddable database system that is gaining in
popularity.  More details can be found here:
<pre>
  <a href="http://www.sqlite.org/">http://www.sqlite.org</a>
</pre>

<p>
The <code>mod_sql_sqlite</code> module is designed to let ProFTPD's
<code>mod_sql</code> module connect to and use a SQLite database.  This module
is contained in the <code>mod_sql_sqlite.c</code> file for ProFTPD 1.3.<i>x</i>,
and is not compiled by default.  Installation instructions are discussed
<a href="#Installation">here</a>.

<p>
The most current version of <code>mod_sql_sqlite</code> is distributed with
ProFTPD.

<h2>Author</h2>
<p>
Please contact TJ Saunders &lt;tj <i>at</i> castaglia.org&gt; with any
questions, concerns, or suggestions regarding this module.

<p>
<hr>
<h2><a name="Installation">Installation</a></h2>
The <code>mod_sql_sqlite</code> modules requires that SQLite be installed.

<p>
After installing SQLite, follow the usual steps for using contrib modules in
ProFTPD, making sure to list <code>mod_sql</code>:
<pre>
  $ ./configure --with-modules=mod_sql:mod_sql_sqlite
  $ make
  $ make install
</pre>
You may need to specify the location of the SQLite header and library files in
your <code>configure</code> command, <i>e.g.</i>:
<pre>
  $ ./configure --with-modules=mod_sql:mod_sql_sqlite \
    --with-includes=/usr/local/sqlite/include \
    --with-libraries=/usr/local/sqlite/lib
</pre>

<p>
Alternatively, if your <code>proftpd</code> was compiled with DSO support, you
can use the <code>prxs</code> tool to build <code>mod_sql_sqlite</code> as
a shared module:
<pre>
  $ prxs -c -i -d mod_sql_sqlite.c
</pre>

<p>
<hr>
<h2><a name="Usage">Usage</a></h2>
For the most part, <code>mod_sql_sqlite</code> requires little configuration.
In the <code>SQLConnectInfo</code> directive, simply use the full path
to the SQLite database file; no username or password are required.  The
<code>SQLBackend</code> provided by <code>mod_sql_sqlite</code> is "sqlite3".

<p>
For example:
<pre>
  &lt;IfModule mod_sql_sqlite.c&gt;
    SQLBackend sqlite3
    SQLConnectInfo /path/to/ftpd.db
  &lt;/IfModule&gt;
</pre>

<p>
Note that due to the way that <code>mod_sql_sqlite</code> implements database
transactions (e.g. <code>INSERT</code> and <code>UPDATE</code> SQL statements
for <code>SQLLog</code> directives), SQLite-3.6.5 or later is <b>required</b>
in order for <code>mod_sql_sqlite</code> to support <code>SQLLog</code>
directives if <code>DefaultRoot</code> or <code>&lt;Anonymous&gt;</code> are
used.  (SQLite-3.6.5 and later support the MEMORY journal mode, which is
needed for supporting the <code>SQLLog</code> directives in a chrooted
process.)

<p>
<hr>
<font size=2><b><i>
&copy; Copyright 2004-2017 TJ Saunders<br>
 All Rights Reserved<br>
</i></b></font>
<hr>

</body>
</html>
